
import React, { useState } from 'react';
import { Row, Col, Card, Switch, Statistic, Tooltip, Space, Tabs } from 'antd'
import { history, connect } from 'umi';
import { ExclamationCircleOutlined, } from '@ant-design/icons'
import PromoterSetting from './components/promoterSetting';
import RuleSetting from './components/ruleSetting';
import ValidUserCondition from './components/validUserCondition';
import ValidPromoterCondition from './components/validPromoterCondition';
const Setting = (props) => {
    const { activeTabKey, setActiveTabKey } = props
    const tabList = [
        {
            label: `基础设置`,
            key: 'ruleSetting',
            children: null,
        },
        {

            label: `推广员设置`,
            key: 'promoterSetting',
        },
        {

            label: `有效用户设置`,
            key: 'validUserCondition',
        },
        {

            label: `有效推广员`,
            key: 'validPromoterCondition',
        },


    ];
    const renderContent = {
        ruleSetting: <RuleSetting></RuleSetting>,
        promoterSetting: <PromoterSetting></PromoterSetting>,
        validUserCondition: <ValidUserCondition></ValidUserCondition>,
        validPromoterCondition: <ValidPromoterCondition></ValidPromoterCondition>
    }[activeTabKey]
    const onTabChange = (key) => {
        setActiveTabKey(key);
    };
    return <Card style={{
        width: '100%',
        minHeight: 900
    }}>
        <Tabs
            onChange={onTabChange}
            activeKey={activeTabKey}
            items={tabList}

            type="card"
        >
        </Tabs>
        {renderContent}
    </Card>


}

export default connect(({ loading }) => ({

    loading: loading.models.institution,
}))(Setting);
